from .models import Plate, PostColumn
from .models import PlateCategory


def create_plate():
    information_plate = Plate()
    information_plate.name = "校园热点"
    information_plate.desc = "记录校园热点生活"
    information_plate.save()

    trade_plate = Plate()
    trade_plate.name = "二手贸易"
    trade_plate.desc = "发布二手物品贸易信息"
    trade_plate.save()

    item_plate = Plate()
    item_plate.name = "物品丢失"
    item_plate.desc = "发布物品丢失信息"
    item_plate.save()

    confession_plate = Plate()
    confession_plate.name = "校园表白"
    confession_plate.desc = "发布表白墙信息"
    confession_plate.save()


def create_category():
    # information_plate=Plate(id=1)
    information_category = PlateCategory()
    information_category.name = "校园热点"
    information_category.plate = Plate.objects.get(name="校园热点")
    information_category.save()

    # trade_plate = Plate(id=2)
    trade_category = PlateCategory()
    trade_category.name = "二手贸易"
    trade_category.plate = Plate.objects.get(name="二手贸易")
    trade_category.save()

    # item_plate = Plate(id=3)
    item_category = PlateCategory()
    item_category.name = "物品丢失"
    item_category.plate = Plate.objects.get(name="物品丢失")
    item_category.save()

    # confession_plate = Plate(id=4)
    confession_category = PlateCategory()
    confession_category.name = "校园表白"
    confession_category.plate = Plate.objects.get(name="校园表白")
    confession_category.save()


def create_column():
    Java_column=PostColumn()
    Java_column.title="Java"
    Java_column.save()

    HTML_column = PostColumn()
    HTML_column.title = "HTML"
    HTML_column.save()

    Django_column = PostColumn()
    Django_column.title = "Django"
    Django_column.save()


